package com.zy.web.demo.duoxiancheng.demo23;

/**
 * @author <a href="mailto:zhouyong@cqyyt.com">zy</a>
 * @version 1.0
 * @date 2020/8/24 10:30
 * join与sleep的区别
 * join的时候，锁可以被释放
 * sleep的时候锁不会被释放
 */
public class ThreadB23 extends Thread{

    @Override
    public void run() {
        try {
            System.out.println("b run");
            Thread.sleep(1000);
            System.out.println("b end");
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
    }

    synchronized public void bserice(){
        System.out.println("bserice");
    }

}
